-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: exit with code 112 when api errors prevent cloud orchestrated runs (record mode, parallel run mode) #32635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cypress
|
Project |
cypress
|
Branch Review |
feat-api-failure-exit-112
|
Run status |
|
Run duration | 16m 49s |
Commit |
|
Committer | Cacie Prins |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
1
|
|
1
|
|
705
|
|
0
|
|
761
|
View all changes introduced in this branch ↗︎ |
UI Coverage
0%
|
|
---|---|
|
4
|
|
0
|
Accessibility
100%
|
|
---|---|
|
0 critical
0 serious
0 moderate
0 minor
|
|
0
|
Tests for review
cypress/e2e/studio/studio.cy.ts • 1 failed test • app-e2e
Test | Artifacts | |
---|---|---|
Cypress Studio > updates an existing test with assertions |
Test Replay
Screenshots
|
cypress/e2e/cypress-origin-communicator.cy.ts • 1 flaky test • app-e2e
return require('./errors').logException(err) | ||
.then(() => { | ||
debug('calling exit 1') | ||
await require('./errors').logException(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason we can just import errors at the top of the file since we are starting to move away from CJS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of how the integration tests are set up, this has to be dynamically required for now :(
break | ||
} | ||
case 'returnPkg': { | ||
const pkg = await require('./modes/pkg')(options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just import pkg from '@packages/root'
at the top of the file since its a bundled package now and just reference it here instead of ./modes/pkg
? Would be much simpler
break | ||
} | ||
case 'info': { | ||
await require('./modes/info')(options) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just hoist this import or await import it? If not I'll likely get to this in the launcher refactor
}) | ||
}) | ||
|
||
it('errors and exits with 1 when posix exit codes are enabled', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the reason the posix tests are added here and not in the posix PR? Is there some type of integration between these two I am missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see its the differences between 112 vs 1 exit code
@@ -0,0 +1,8 @@ | |||
[31mWe encountered an unexpected error communicating with our servers.[39m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is so much easier to diff now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really really is!
packages/server/lib/cypress.ts
Outdated
} | ||
} | ||
|
||
debug('calling exit 1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove I believe
packages/server/lib/modes/record.ts
Outdated
import { getError, AllCypressErrorNames } from '@packages/errors' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { getError, AllCypressErrorNames } from '@packages/errors' | |
import { getError } from '@packages/errors' | |
import type { AllCypressErrorNames } from '@packages/errors' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 660ab1b
packages/server/lib/modes/record.ts
Outdated
}) | ||
default: | ||
return throwErr('CLOUD_UNKNOWN_INVALID_REQUEST', { | ||
throw throwErr('CLOUD_UNKNOWN_INVALID_REQUEST', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not understanding why this would change to throw either.
Additional details
Adds
112
as a potential exit code when Cypress is run with POSIX complaint exit codes enabled (--posix-exit-codes
). This exit code is used when--record
or--parallel
mode is unable to communicate with Cypress Cloud API due to network conditions.Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
? docs: Adds documentation for the112
exit code when posix-compliant exit codes are enabled. cypress-documentation#6294type definitions
?Note
When recording/parallel runs hit Cloud network errors with --posix-exit-codes, exit with code 112; add network-specific error types and make Cloud API timeouts configurable.
112
for Cloud network failures in--record
/--parallel
when--posix-exit-codes
is enabled; refactorstartInMode
and inlineexitWithCode
handling.CLOUD_CANNOT_PROCEED_IN_PARALLEL_NETWORK
andCLOUD_CANNOT_PROCEED_IN_SERIAL_NETWORK
to GraphQL schema and implement corresponding error templates and snapshots.defaultTimeout()
(honorsCYPRESS_INTERNAL_API_TIMEOUT
) and use it across requests instead of a fixed 60s timeout.EarlyExitTerminator.waitForEarlyExit
signature).112
, network error paths, grouping/parallel behaviors, and timeout scenarios.15.5.0
.Written by Cursor Bugbot for commit 65d7718. This will update automatically on new commits. Configure here.